<?php
	header('Content-type: text/html; charset=utf-8');

	session_start(); 
	
	function post_check($post)     
		{    
		if (!get_magic_quotes_gpc()) // 判断magic_quotes_gpc是否为打开  
		{    
		$post = addslashes($post); // 进行magic_quotes_gpc没有打开的情况对提交数据的过滤
		}     
		$post = str_replace("_", "\_", $post); // 把 '_'过滤掉   
		  $post = str_replace("%", "\%", $post); // 把' % '过滤掉   
		  $post = nl2br($post); // 回车转换   
		  $post= htmlspecialchars($post); // html标记转换  
		     
			 return $post;     
			 }   
			 
			 
	
	
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密码页面</title>
<script language="javascript">
	function check()
	{	
		
		if(document.form.old_pwd.value=="")
		{
		alert("请输入密码！！")
		document.form.old_pwd.focus();
		return false
		}
		if(document.form.new_pwd1.value=="")
		{
		alert("请输入新密码！！")
		document.form.new_pwd1.focus();
		return false
		}
		if(document.form.new_pwd2.value=="")
		{
		alert("请再次输入新密码！！")
		document.form.new_pwd2.focus();
		return false
		}
		
		if ((document.form.new_pwd1.value.length !=0 &&document.form.new_pwd1.value.length < 8)||document.form.new_pwd1.value.length >16)
		{
	  alert("对不起，你所填的密码不符合长度的要求，请重新输入！")
	  document.form.new_pwd1.focus()
	  return false
		 }
		 if ((document.form.new_pwd1.value.length !=0 &&document.form.new_pwd1.value.length < 8)|document.form.new_pwd1.value.length >16)
		{
	  alert("对不起，你所填的密码不符合长度的要求，请重新输入！")
	  document.form.new_pwd2.focus()
	  return false
		 }
		 if (document.form.new_pwd1.value !=document.form.new_pwd2.value)
		{
	  alert("对不起，你两次所填的新密码不相同，请重新输入！")
	  return false
		 }
		  if (document.form.old_pwd.value!="<?php echo $login_pwd ;?>")
		{
	  alert("对不起，你输入的旧密码不正确，请重新输入！")
	  return false
		 }
	}
 

</script>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE24 {color: #FF0000}
-->
</style>
</head>
<?php /*
$mysql_server_name = "localhost";
$mysql_username = "root";
$mysql_password = "root";
$mysql_database = "db_shop";

 $conn=mysql_connect($mysql_server_name,$mysql_username,$mysql_password);

$id= $_GET['id'];
$sql = "select * from operator where operator_id='$id'";
	//require_once('page.php');
	//page($sql,'room.php',"5");//这几句是分页的句子！！
	//$sql = " SELECT * FROM room ORDER BY room_id DESC limit".$begincount.",".$rows; 
	mysql_query ("set names 'utf8'");
      mysql_select_db($mysql_database);
   $result=mysql_query( $sql);
$row =mysql_fetch_array($result,MYSQL_ASSOC);*/
?>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 修改密码</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">&nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
		<tr>
		  <td height="35" colspan="2" bgcolor="d3eaef" class="STYLE6"><div align="center" class="STYLE1 STYLE26"><strong>修改密码 </strong></div></td>
		</tr>
		<form name="form" id="form" method="post"  onsubmit="return check()"action="updatepsw_add.php">
		<tr>
			<td width="108" height="40" bgcolor="d3eaef" class="STYLE6">姓名:</td>
			<td width="662"  bgcolor="#FFFFFF" class="STYLE19"><input type="text" name="name"  id="name" /></td>
		</tr>
		<tr>
			<td width="108" height="40" bgcolor="d3eaef" class="STYLE6">旧密码:</td>
			<td width="662"  bgcolor="#FFFFFF" class="STYLE19"><input type="password" name="old_pwd"  id="old_pwd" /></td>
		</tr>
		<tr>
			<td height="50" bgcolor="d3eaef" class="STYLE6">新密码:</td>
			<td  bgcolor="#FFFFFF" class="STYLE19"><input type="password" name="new_pwd1" />
		  <span class="STYLE2 STYLE26"><strong>*密码长度必须大于4个小于18个字符！</strong></span></td>
		</tr>
		<tr>
			<td height="63" bgcolor="d3eaef" class="STYLE6">再输入新密码:</td>
			<td  bgcolor="#FFFFFF" class="STYLE19"><input type="password" name="new_pwd2" /></td>
		</tr>
		<tr>
			<td height="52" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			  <input name="submit" type="submit" value="确定修改" />
&nbsp;&nbsp;&nbsp;&nbsp;
		  <input name="reset" type="reset" value="重置" /></td>
		  </tr>
		</form>
      
	
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        
       
          
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
